package com.fosun.spr.core.base;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * 
 * @author zhangcheng
 * @descirbe context
 *
 */
public class SprApplicationContext implements ApplicationContextAware{

	private static ApplicationContext sprContext;
	
	 
	public void setApplicationContext(ApplicationContext applicationContext)
			throws BeansException {
		setSprContext(applicationContext);
	}

	public static Object getBean(String name) throws BeansException {
		return sprContext.getBean(name);
	}

	
	public static void setSprContext(ApplicationContext sprContext) {
		SprApplicationContext.sprContext = sprContext;
	}
	
	public ApplicationContext getSprContext() {
		return sprContext;
	}

}
